﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Upreader.Application.Model
{
    /// <summary>
    /// Simple comparison for segments based on index.
    /// </summary>
    class SegmentComparer : IComparer<Segment>
    {
        int IComparer<Segment>.Compare(Segment x, Segment y)
        {
            if (x == null)
                return -1;
            if (y == null)
                return 1;

            return y.Index - x.Index;
        }
    }
}
